package com.ruoyi.blog.domain;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.NumberFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.List;

/**
 * 博客文章对象 blog_article
 *
 * @author 刘哲贤
 * @date 2022-08-15
 */
public class BlogArticle extends BaseEntity {
    /**
     * 未删除
     */
    public static final String NOT_DELETED = "0";
    /**
     * 已删除
     */
    public static final String IS_DELETED = "1";
    /**
     * 未发布
     */
    public static final String NOT_RELEASE = "0";
    /**
     * 已发布
     */
    public static final String IS_RELEASE = "1";
    private static final long serialVersionUID = 1L;
    /**
     * $column.columnComment
     */
    @ExcelProperty(value = "id")
    private Integer id;

    /**
     * 文章标题
     */
    @ExcelProperty(value = "文章标题")
    private String title;

    /**
     * 文章描述
     */
    @ExcelProperty(value = "文章描述")
    private String description;

    /**
     * 文章作者id
     */
    private Long createdUserId;

    /**
     * 文章类型id
     */
    private Integer typeId;

    /**
     * 标签(最多5个，逗号分割）
     */
    private String tag;

    /**
     * 文章内容(markerdown)
     */
    private String markerdownMessage;

    /**
     * 是否置顶(0:否,1:是)
     */
    @ExcelProperty(value = "是否置顶")
    @NumberFormat(value = "0=否,1=是")
    private String isTop;

    /**
     * 阅读次数
     */
    @ExcelProperty(value = "阅读次数")
    private Long count;

    /**
     * 是否发布(0:否;1:是)
     */
    @ExcelProperty(value = "是否发布")
    @NumberFormat(value = "0=否,1=是")
    private String isRelease;

    /**
     * 是否删除(0:否;1:是)
     */
    @ExcelProperty(value = "是否删除")
    @NumberFormat(value = "0=否,1=是")
    private String deleted;

    /**
     * 新增的标签list
     */
    private List<BlogTag> tagList;
    /**
     * 多选的 tagId
     */
    private List<Integer> tagArr;

    private Integer commentCount;

    public Integer getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(Integer commentCount) {
        this.commentCount = commentCount;
    }

    public List<BlogTag> getTagList() {
        return tagList;
    }

    public void setTagList(List<BlogTag> tagList) {
        this.tagList = tagList;
    }

    public List<Integer> getTagArr() {
        return tagArr;
    }

    public void setTagArr(List<Integer> tagArr) {
        this.tagArr = tagArr;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Long getCreatedUserId() {
        return createdUserId;
    }

    public void setCreatedUserId(Long createdUserId) {
        this.createdUserId = createdUserId;
    }

    public Integer getTypeId() {
        return typeId;
    }

    public void setTypeId(Integer typeId) {
        this.typeId = typeId;
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public String getMarkerdownMessage() {
        return markerdownMessage;
    }

    public void setMarkerdownMessage(String markerdownMessage) {
        this.markerdownMessage = markerdownMessage;
    }

    public String getIsTop() {
        return isTop;
    }

    public void setIsTop(String isTop) {
        this.isTop = isTop;
    }

    public Long getCount() {
        return count;
    }

    public void setCount(Long count) {
        this.count = count;
    }

    public String getIsRelease() {
        return isRelease;
    }

    public void setIsRelease(String isRelease) {
        this.isRelease = isRelease;
    }

    public String getDeleted() {
        return deleted;
    }

    public void setDeleted(String deleted) {
        this.deleted = deleted;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("title", getTitle())
                .append("description", getDescription())
                .append("createdUserId", getCreatedUserId())
                .append("typeId", getTypeId())
                .append("tag", getTag())
                .append("tagArr", getTagArr())
                .append("tagList", getTagList())
                .append("markerdownMessage", getMarkerdownMessage())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .append("isTop", getIsTop())
                .append("count", getCount())
                .append("isRelease", getIsRelease())
                .append("deleted", getDeleted())
                .append("commentCount", getCommentCount())
                .toString();
    }
}
